#include "dut/Image.h"

#include "stb/stb_image.h"

bool Dut::Image::Load(const std::string& path, const unsigned int reqComp)
{
	m_Data = stbi_load(path.c_str(), &m_Width, &m_Height, &m_NrComponents, reqComp);
	return m_Data;
 
}

void Dut::Image::Release()
{
	if (m_Data != 0)
	{
		stbi_image_free(m_Data);
		m_Data = 0;
	}
}

Dut::Image::~Image()
{
	Release();
}
